//
// Created by wze-zero on 2024/9/17 017.
//
#include <iostream>

using namespace std;

int main() {
    char c[3][3];
    char ch;
    bool check = false;
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> c[i][j];
        }
    }
    for (int i = 0; i < 3; ++i) {
        if (c[i][0] == c[i][1] && c[i][1] == c[i][2]) {
            check = true;
            ch = c[i][0];
            break;
        }
        if (c[0][i] == c[1][i] && c[1][i] == c[2][i]) {
            check = true;
            ch = c[0][i];
            break;
        }
    }
    if (!check) {
        if (c[0][0] == c[1][1] && c[1][1] == c[2][2]) {
            check = true;
            ch = c[0][0];
        } else if (c[0][2] == c[1][1] && c[1][1] == c[2][0]) {
            check = true;
            ch = c[1][1];
        }
    }
    if (check) {
        if (ch == 'K') {
            cout << "KiKi wins!" << endl;
        } else if (ch == 'B') {
            cout << "BoBo wins!" << endl;
        } else {
            cout << "No winner!" << endl;
        }
    } else {
        cout << "No winner!" << endl;
    }
    return 0;
}